/**
 * @Title: ExceptionHandler
 * @Package cn.com.yiqi.wsc.api.controller
 * @Description: TODO
 * Copyright: Copyright (c) 2016
 * Company: 成都壹柒互动科技有限公司
 * @author 会员系统组-林威
 * @date 2017/4/1 19:37
 * @version V1.0
 */
package cn.com.yiqi.wsc.api.controller;

import cn.com.yiqi.wsc.common.Result;
import cn.com.yiqi.wsc.common.ResultUtil;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 *
 *@ClassName: ExceptionHandler
 * Description: TODO
 * @author 会员系统组-林威
 * @date 2017/4/1 19:37
 *
 */
@ControllerAdvice
@ResponseBody
public class RestExceptionHandler {
    static Result re = new Result();

    //500错误
    @ExceptionHandler(RuntimeException.class)
    public Result server500(RuntimeException runtimeException){
      return ResultUtil.fail(re,"系统错误");
    }

}
